﻿using System;
using System.Windows.Forms;

namespace MyBuild.WindowsNotifications
{

    /// <summary>
    /// The main form to shao current  status of wacthed local builds 
    /// </summary>
    /// <remarks>
    /// Look to replace this module witht a clean more moderised WPF module. 
    /// See http://www.hardcodet.net/projects/wpf-notifyicon
    /// </remarks>
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void restoreApplicationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Show();
            WindowState = FormWindowState.Normal;
            Focus();
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void Form1_SizeChanged(object sender, EventArgs e)
        {
            if(WindowState == FormWindowState.Minimized)
            {
                Hide();
                notifyIcon1.Visible = true;
            }
            else
            {
                notifyIcon1.Visible = false;
            }
        }
    }
}
